{% extends 'adminbase.html' %}
{% block content_admin %}
	
	Updating Page :

	{% if page %}
		{{ page.title }} [<a href="/admin/admin_detailpage/{{page.pk}}/">View</a>]
		
		<form action="/admin/admin_updatepage/{{page.pk}}/" method="post">
		    <table>
		    {{form.as_table}}
		    </table>
		    <input type="submit" value="submit">
		</form>
	{% else %}
	    <p>No page found.</p>
	{% endif %}
	
	  <script type="text/javascript">
	  	$('#id_content').wysiwyg({
		    controls: {
		        strikeThrough: { visible: true },
		        underline: { visible: true },
		        subscript: { visible: true },
		        superscript: { visible: true }
		    }
		});
		$(".wysiwyg > iframe").css("width","500px");;
		$('.wysiwyg').css("width","500px");
		$('.wysiwyg').addClass('richtext_panel');
	  </script>
{% endblock %}

{% block content_admin_menu %}

	{% if page %}
		<h3 class="page-content-menu-tab">Slideshow</h3>
		<form action="/admin/admin_updatelink_slideshowpageByPage/{{page.pk}}/" method="post" class="page-list-item">
			<input type="hidden"  name="page_pk"  value="{{page.pk}}">
			<input type="hidden"  name="return_url"  value="/admin/admin_updatepage/{{page.pk}}/">
			<SELECT name="selected_slideshow">
		        {% for slideshow in slideshow_list %}
					<OPTION VALUE="{{ slideshow.pk }}">{{ slideshow.title }}</OPTION>
			    {% endfor %}
			</SELECT>
			<INPUT type="submit" value="Add">
		</form>
		
		{% for slideshowLink in slideshow_linked_list %}
		<div class="page-list-item">
			[<a title="Remove" class="page-list-item-action-remove" 
				href="/admin/admin_deletelink_slideshowpage/{{slideshowLink.pk}}/
							?return_url=/admin/admin_updatepage/{{page.pk}}/">-</a>]
			<a class="page-list-item-link" href="/admin/admin_detailslideshow/{{slideshowLink.slideshow.pk}}/">
				{{ slideshowLink.slideshow.title }}
			</a>
		</div>
	    {% endfor %}
    {% endif %}
{% endblock %}
